package org.carl.base.dingtalk.bot.service;

import org.carl.base.dingtalk.bot.bean.DingTalkRobotVo;
import org.carl.base.dingtalk.bot.model.DingTalkResult;
import org.carl.base.dingtalk.bot.model.MsgModel;

/**
 * @author Carl
 */
public interface DingTalkService {

    /**
     * 手动发送一条消息
     *
     * @param webhook  String webhook地址
     * @param secret   String 密钥
     * @param msgModel MsgModel 消息
     * @return DingTalkResult
     * @throws Exception
     */
    DingTalkResult sendBot(String webhook, String secret, MsgModel msgModel) throws Exception;

    /**
     * 发送一条消息
     *
     * @param robot    DingTalkRobotVo 机器人数据
     * @param msgModel MsgModel 消息
     * @return DingTalkResult
     * @throws Exception
     */
    DingTalkResult sendBot(DingTalkRobotVo robot, MsgModel msgModel) throws Exception;

    /**
     * 发送一条消息
     *
     * @param robotId  DingTalkRobotVo 机器人ID
     * @param msgModel MsgModel 消息
     * @return DingTalkResult
     * @throws Exception
     */
    DingTalkResult sendBot(String robotId, MsgModel msgModel) throws Exception;

    /**
     * 根据id获取机器人数据
     *
     * @param robotId
     * @return
     */
    DingTalkRobotVo getRobot(String robotId);
}
